<template>
	<section>
		<headers txt="我的车险"></headers>
		<ul class="hue333 wallfff mu20" v-if="autos" v-infinite-scroll="auto" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
			<li class="bbtm p30  flex_middle flex_between" v-for="item in autos">
				<span class="sz30">{{item.CarInsurance_CarNum}}</span>
				<div class="centre sz28">
					<span>
						{{item.CarInsurance_ApplyTime}}
					</span>
					<br>
					<strong class="fontwt" v-if="item.CarInsurance_Mark===0">待审核</strong>
					<strong class="fontwt" v-else>已审核</strong>
				</div>
			</li>
		</ul>
		<p v-else class="centre mu50">没有信息</p>
		<p class="centre pud30" v-if="nones">没有更多了</p>
	</section>
</template>

<script>
	import { InfiniteScroll } from 'mint-ui';
	import { Toast } from 'mint-ui';
	import { Indicator } from 'mint-ui';
	export default {
		data() {
			return {
				autos: [],
				pageIndex: 1,
				PageCount: 1,
				nones: false
			}
		},
		created() {
			
		},
		methods: {
			auto: function() {
				let v = this;
				if(v.pageIndex <= v.PageCount) {
					Indicator.open();
					v.$http.get('/WorkCarInsurance/V1.0/GetMembersCarInsurance', {
						params: {
							"MembersID": v.$store.state.MembersID,
							"pageIndex": v.pageIndex++
						}
					}).then((res) => {
						Indicator.close();
						if(!res.data.Return_ID) {
							let resdata = res.data.Return_Data.PageData;
							if(!resdata || !resdata.length) {
								v.autos = null;
								return false;
							}
							resdata.forEach(function(item) {
								item.CarInsurance_ApplyTime = item.CarInsurance_ApplyTime.replace(/(T|\.\d+)/gim, " ");
								v.autos.push(item);
							});
							v.PageCount = res.data.Return_Data.PageCount;

						} else {
							Toast(res.data.Return_Mess);
						}

					}).catch((err) => {
						Indicator.close();
						Toast(err);
					});
				} else {
					v.nones = true;
				}

			},
		},

	}
</script>

<style>

</style>